package Enum;
/*本类用于自定义枚举类*/
public class Demo01 {
    public static void main(String[] args) {
        System.out.println(Season.SPRING.getSEASON_NAME());//春季
        System.out.println(Season.SUMMER.getSEASON_DESC());//夏日炎炎
        System.out.println(Season.AUTUMN);
    }
}
class Season{
    //2.定义本类的私有属性,为了防止值被修改，需要设置为final
    private final String SEASON_NAME;//季节名
    private final String SEASON_DESC;//季节描述

    //3.私有化本类的构造方法--防止外界随意创建本类对象
    private Season(String season_name, String season_desc) {
        this.SEASON_NAME = season_name;//在构造中给本类的属性赋值
        this.SEASON_DESC = season_desc;
    }
    //4.提供当前枚举类的多个对象
    public final static Season SPRING = new Season("春季","春暖花开");
    public final static Season SUMMER = new Season("夏季","夏日炎炎");
    public final static Season AUTUMN = new Season("秋季","秋高气爽");
    public final static Season WINTER = new Season("冬季","冬雪凛凛");
    //5.生成对应的get的方法，获取本类的两个属性值
    public String getSEASON_NAME() {
        return SEASON_NAME;
    }

    public String getSEASON_DESC() {
        return SEASON_DESC;
    }
    //6.生成toString方法方便查看


    @Override
    public String toString() {
        return "Season{" +
                "SEASON_NAME='" + SEASON_NAME + '\'' +
                ", SEASON_DESC='" + SEASON_DESC + '\'' +
                '}';
    }
}
